package com.novax.ex.activity.open.api.inner;

import com.novax.ex.activity.open.model.request.task.TaskVersionInfoRequest;
import com.novax.ex.activity.open.model.response.task.TaskDropDownResponse;
import com.novax.ex.activity.open.model.response.task.TaskVersionInfoResponse;
import com.novax.ex.common.results.ReturnResult;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import jakarta.validation.Valid;
import java.util.List;

/**
 * Description: 后台-新手任务配置
 *
 * @author shaw
 * @date 2023/6/19 15:03
 */
@Tag(name = "后台 新手引导任务配置", description = "后台 新手引导任务配置")
@FeignClient(url = "${remote.activity-service.endpoint}", name = "TaskVersionInfoApi", contextId = "TaskVersionInfoApi")
public interface TaskVersionInfoApi {

    @Operation(summary = "新手任务配置查询")
    @GetMapping(value = "/v3/private/task/versions/{id}/tasks")
    ReturnResult<List<TaskVersionInfoResponse>> query(@RequestHeader("language") String language,
                                                      @PathVariable Long id);

    @Operation(summary = "编辑任务下拉框")
    @GetMapping(value = "/v3/private/tasks/template")
    ReturnResult<List<TaskDropDownResponse>> dropDownBox();

    @Operation(summary = "编辑任务")
    @PostMapping(value = "/v3/private/task/versions/tasks/{id}")
    ReturnResult<?> taskModify(@RequestHeader("language") String language,
                               @PathVariable Long id,
                               @RequestBody @Valid TaskVersionInfoRequest taskVersionInfoRequest,
                               BindingResult bindingResult);


    @Operation(summary = "开启/关闭twitter真实性校验")
    @Parameters({
            @Parameter(name = "type", description = "1：开启 0：关闭")
    })
    @PostMapping(value = "/v3/private/twitter/verify/{type}")
    ReturnResult<?> verifyTwitter(@PathVariable Integer type);


    @Operation(summary = "查询twitter真实性校验")
    @GetMapping(value = "/v3/private/twitter/find")
    ReturnResult<?> verifyTwitterFind();
}
